home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Sep 89 / Y0050-MPW PASCAL 3.0 Bug?-Sep89 < prev    next >
Encoding:
Text File  |  1989-09-14  |  2.2 KB  |  83 lines  |  [TEXT/GEOL]

  1. Item    2453424                         14-Sept-89        16:45
  2.  
  3. From:   KAMAN                           Kaman Sciences, D Holmgren,PRT
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    MPW PASCAL 3.0 Bug?
  8.  
  9. I have a question regarding code generated by the MPW Pascal 3.0 compiler.
  10. The following code segments each contain a method call.  The first method call
  11. restores A0 when it returns, and happily uses the register.
  12. The second code segment, upon return from the JSR, does not restore A0 (which,
  13. being a scratch register, was modified in the ConstructTemplates method), and
  14. thus walks on memory.
  15.  
  16.  
  17. Code segment 1:
  18.  
  19.    PROCEDURE TExperiment.IExperiment;
  20.  
  21.    VAR
  22.    aStr:   Str255;
  23.    theTime:LONGINT;
  24.  
  25.    BEGIN
  26.    IDocument (kExpFileType, kSignature, kUsesDataFork, kUsesRsrcFork,
  27.    NOT kDataOpen, kRsrcOpen);
  28.    .
  29.    .
  30.    .
  31.    SetExperimentTitle;
  32.    fAutoArm := FALSE;
  33.    fAutoReadout := FALSE;
  34.    fAutoProcess := FALSE;
  35.    .
  36.    .
  37.    .
  38.    END; { TExperiment.IExperiment }
  39.  
  40.  
  41.    The interior lines are, when disassembled,
  42.  
  43.    00000126: 4EBA 0000      'N...'            JSR
  44. TEXPERIMENT$SETEXPERIMENTTITLE ; id: 33
  45.    0000012A: 2054           ' T'              MOVEA.L    (A4),A0
  46.    0000012C: 4228 02B3      'B(..'            CLR.B      $02B3(A0)
  47.    00000130: 4228 02B4      'B(..'            CLR.B      $02B4(A0)
  48.    00000134: 4228 02B5      'B(..'            CLR.B      $02B5(A0)
  49.  
  50.  
  51. Code segment 2:
  52.  
  53.    PROCEDURE TMyChanMgr.IChanMgr;
  54.    BEGIN
  55.    IDocument (kChanDefFileType, kSignature, kUsesDataFork, NOT kUsesRsrcFork,
  56.     NOT kDataOpen, NOT kRsrcOpen);
  57.    .
  58.    .
  59.    .
  60.    fPulseChan3 := 7;
  61.    fBaseCalDelay := 1;
  62.    ConstructTemplates;
  63.    fBaseCtlString := kNull;
  64.    fDataCtlString := kNull;
  65.    .
  66.    .
  67.    .
  68.     END; { TMyChanMgr.IChanMgr }
  69.  
  70.  
  71.    The interior lines are, when disassembled,
  72.  
  73.    000000F6: 317C 0007 04F0 '1|....'          MOVE.W     #$0007,$04F0(A0)
  74.    000000FC: 317C 0001 04F2 '1|....'          MOVE.W     #$0001,$04F2(A0)
  75.    00000102: 2F0B           '/.'              MOVE.L     A3,-(A7)
  76.    00000104: 4EBA 0000      'N...'            JSR
  77. TMYCHANMGR$CONSTRUCTTEMPLATES ; id: 48
  78.    00000108: 4228 01EA      'B(..'            CLR.B      $01EA(A0)
  79.    0000010C: 4228 03EA      'B(..'            CLR.B      $03EA(A0)
  80.  
  81. Any comments?
  82.  
  83.